<template>
  <div class="pay">
    <el-card class="box-card">
      <div slot="header" class="clearfix" style="margin-bottom: 10px">
        <span>报到信息</span>
      </div>
      <el-form ref="formRef" :model="formData" label-width="100px">
        <el-form-item label="学号" prop="sno">
          <el-input v-model="formData.sno" readonly></el-input>
        </el-form-item>
        <el-form-item label="报到时间" prop="arrdt">
          <el-input v-model="formData.arrdt" readonly></el-input>
        </el-form-item>
        <el-form-item label="报到状态" prop="arrStatus">
          <el-input v-model="formData.arrStatus" readonly></el-input>
        </el-form-item>
      </el-form>
    </el-card>
  </div>
</template>
<script setup>
import {onMounted, reactive} from "vue";
import request from "../../../utils/request";

onMounted(()=>{
  info();
  getRecords();
})
const formData = reactive({
  'sno':'',
  'arrdt':'',
  'arrStatus':''
});
const  userInfo=reactive({
  'sno':''
})
const info=()=>{
  //从sessionstorage取出数据
  const loginUser=sessionStorage.getItem("loginUser");
  if (loginUser){
    //更新userInfo.username
    const userobj=JSON.parse(loginUser)
    userInfo.sno=userobj.sid;
    console.log(userInfo.sno)
  }
}
const getRecords=()=>{
  request({
    url:'/arrive/one',
    method:'get',
    params:{
      sno:userInfo.sno,
    }
  }).then((req)=>{
    console.log(req)
    formData.sno=req.data.data.sno;
    formData.arrStatus=req.data.data.status;
    formData.arrdt=req.data.data.arrdt;
  })
}
</script>
<style scoped>
.pay{
  width: 300px;
  height: 480px;
  margin: 50px auto;
}
</style>